<?php
/**
 * Created by PhpStorm.
 * User: myhonour
 * Date: 2017/9/27
 * Time: 21:45
 */

namespace app\admin\model;


class AuthRule extends \think\Model
{

    /** 检查一个 权限是否 真实存在
     * @param $action
     * @return bool
     */
    public static function checkExistence($action){
        // module/controller/action
        $action  =  explode('/',$action);
        if (count($action) !== 3) return false;
          $className    =   '\app\\'.$action[0].'\controller\\'.$action[1];
          if (!class_exists($className) || !method_exists($className,$action[2])) return false;
          return true;
    }


}